<template>
  <div>
    <nav-bar>
      <template v-slot:default>商品详情:{{ id }}</template>
    </nav-bar>
  </div>
</template>

<script>
import NavBar from "@/components/common/navbar/NavBar";
/*带R的是路由-指定路径的，这里不带R是接收参数的，一进一出*/
import {useRoute} from 'vue-router'
import {ref} from 'vue'

export default {
  name: "detail",
  components: {NavBar},
  setup() {
    const route = useRoute()
    let id = ref(0)
    /*GET参数传递,还可以使用动态路由*/
    id.value = route.query.id
    return {
      id
    }
  }
}
</script>

<style scoped>

</style>
